<!DOCTYPE HTML><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><? echo $title ?></title>
<? require("lib.php"); ?>
</head>
<body>
  <div class="container-fluid"><!-- Start Content Box -->
	  <div class="row-fluid">
	    <div class="span12">
	     <div class="wedge10px"></div>
	      <ul class="breadcrumb">
	      <li><a href="configuration.php"><?=ROOT_INDEX_PAGE?></a> <span class="divider">/</span></li>
	      <li class="active"><? echo $title ?></li>
	    </ul>
	    <div class="content-box-content">
<?

	//print_r($most_view);
	//print_r($most_sold);
	//print_r($lastest_orders);
	//print_r($most_searched_keywords);
?>

	<table width="99%" cellspacing="0" cellpadding="3">
	<tr>
		<td width="50%" valign="top">
		<h3><?=ROOT_MOST_VIEWED_5_PRODUCTS?></h3>
<?
		$str= '<table width="99%" cellspacing="0" cellpadding="3" class="mlist" id="picbox">';
		$str.='<tr class="th"><td><strong>'.ROOT_NAME.'</strong></td><td><strong>'.ROOT_SKU.'</strong></td><td><strong>'.ROOT_PRICE.'</strong></td><td><strong>'.ROOT_HIT_COUNT.'</strong></td><td><strong>'.ROOT_SOLD_QUANTITY.'</strong></td><td><strong>'.ROOT_STOCK.'</strong></td></tr>';
		$count=1;
    	foreach($most_view as $row)
		{
			$id=$row['id'];
      		$str.='<tr><td><a href="product.php?do=update&id='.$id.'">'.decode($row['name_'.$lang]).'</a></td>';
			$str.='<td>'.$row['sku'].'</td><td>'.$currency_sign.' '.$row['price'].'</td><td>'.$row['hit_count'].'</td><td>'.$row['sold_quantity'].'</td><td>'.$row['stock'].'</td></tr>';              
			$count++;
		}
		$str.= "</table>";
		if($count==1) $str.= "<br>".ROOT_NO_DATA."!";
		echo $str;
?>
		</td>
		<td width="50%" valign="top">
		<h3><?=ROOT_MOST_SOLD_5_PRODUCTS?></h3>

<?
		$str= '<table width="99%" cellspacing="0" cellpadding="3" class="mlist" id="picbox">';
		$str.='<tr class="th"><td><strong>'.ROOT_NAME.'</strong></td><td><strong>'.ROOT_SKU.'</strong></td><td><strong>'.ROOT_PRICE.'</strong></td><td><strong>'.ROOT_HIT_COUNT.'</strong></td><td><strong>'.ROOT_SOLD_QUANTITY.'</strong></td><td><strong>'.ROOT_STOCK.'</strong></td></tr>';
		$count=1;
    	foreach($most_sold as $row)
		{
			$id=$row['id'];
      		$str.='<tr><td><a href="product.php?do=update&id='.$id.'">'.decode($row['name_'.$lang]).'</a></td>';
			$str.='<td>'.$row['sku'].'</td><td>'.$currency_sign.' '.$row['price'].'</td><td>'.$row['hit_count'].'</td><td>'.$row['sold_quantity'].'</td><td>'.$row['stock'].'</td></tr>';              
			$count++;
		}
		$str.= "</table>";
		if($count==1) $str.= "<br>".ROOT_NO_DATA."!";
		echo $str;
?>
		</td>
		</tr>
		<tr><td colspan="2"> <br class="clear" /></td></tr>
		<tr><td colspan="2"> <br class="clear" /></td></tr>
		
		
		<tr>
		<?if(is_module_enabled($option_module['product_review'])) {?>
		<td width="50%" valign="top">
		<h3><?=ROOT_MOST_REVIEWED_5_PRODUCTS?></h3>
<?
		$str= '<table width="99%" cellspacing="0" cellpadding="3" class="mlist" id="picbox">';
		$str.='<tr class="th"><td><strong>'.ROOT_NAME.'</strong></td><td><strong>'.ROOT_SKU.'</strong></td><td><strong>'.ROOT_PRICE.'</strong></td><td><strong>'.ROOT_HIT_COUNT.'</strong></td><td><strong>'.ROOT_SOLD_QUANTITY.'</strong></td><td><strong>'.ROOT_STOCK.'</strong></td><td><strong>'.ROOT_REVIEWED_COUNT.'</strong></td></tr>';
		$count=1;
    	foreach($most_reviewed as $tmp)
		{
			$product_id=$tmp['product_id'];
			$row=$product->get_row($product_id);
      		$str.='<tr><td><a href="product.php?do=update&id='.$id.'">'.decode($row['name_'.$lang]).'</a></td>';
			$str.='<td>'.$row['sku'].'</td><td>'.$currency_sign.' '.$row['price'].'</td><td>'.$row['hit_count'].'</td><td>'.$row['sold_quantity'].'</td><td>'.$row['stock'].'</td><td>'.$tmp['cnt'].'</td></tr>';              
			$count++;
		}
		$str.= "</table>";
		if($count==1) $str.= "<br>".ROOT_NO_DATA."!";
		echo $str;
?>
		</td>
		<?}?>
		<td width="50%" valign="top">
		<h3><?=ROOT_MOST_SEARCHED_5_KEYWORDS?></h3>

<?
		$str= '<table width="99%" cellspacing="0" cellpadding="3" class="mlist" id="picbox">';
		$str.='<tr class="th"><td><strong>'.ROOT_KEYWORD.'</strong></td><td><strong>'.ROOT_SEARCH_COUNT.'</strong></td></tr>';
		$count=1;
    	foreach($most_searched_keywords as $row)
		{
			$id=$row['id'];
      		$str.='<tr>';
			$str.='<td>'.$row['text'].'</td><td>'.$row['hit_count'].'</td></tr>';              
			$count++;
		}
		$str.= "</table>";
		if($count==1) $str.= "<br>".ROOT_NO_DATA."!";
		echo $str;
?>
		</td>
		</tr>
		<tr><td colspan="2"> <br class="clear" /></td></tr>
		<tr><td colspan="2"> <br class="clear" /></td></tr>
		
		
		
		<tr>
		<td colspan="2">
		<h3><?=ROOT_LATEST_5_ORDERS?></h3>
<?
		$str= '<table width="99%" cellspacing="0" cellpadding="3" class="mlist" id="picbox">';
		$str.='<tr class="th"><td><strong>'.ROOT_ORDER_REFERENCE_NUMBER.'</strong></td><td><strong>'.ROOT_PRODUCT.'</strong></td><td><strong>'.ROOT_AMOUNT.'</strong></td><td><strong>'.ROOT_PAYMENT_METHOD.'</strong></td><td><strong>'.ROOT_ORDER_STATUS.'</strong></td><td><strong>'.ROOT_ORDER_TIME.'</strong></td><td><strong>'.ROOT_PAID_TIME.'</strong></td></tr>';
		$count=1;
		$status=$code_array['order_status'];
    	foreach($lastest_orders as $row)
		{
			$tem=$sales_order_detail->get_rows(64,'sales_order_id',$row['id']);
			$iteming='';
			foreach( $tem as $r ){
				$tempro=$product->get_row($r['product_id']);
				$sku=$tempro['sku'];
				$iteming.=$sku.' * '.$r['quantity'];
				$iteming.='<br />';
			}
			$cstatus=$status[$row['order_status']]['name_'.$lang];
			$currency_sign=$arrcurrency[$row['currency_id']]['sign'];
			$payment_method_name=$payment_method->get_name($row['payment_method_id'],$lang);
			$id=$row['id'];
      		$str.='<tr><td><a href="sales_order.php?do=update&id='.$id.'">'.decode($row['ref_no']).'</a></td><td>';
			$str.=$iteming.'</td><td>'.$currency_sign.' '.$row['total_price'].'</td><td>'.$payment_method_name.'</td><td>'.$cstatus.'</td><td>'.$row['created_time'].'</td><td>'.$row['paid_time'].'</td></tr>';              
			$count++;
		}
		$str.= "</table>";
		if($count==1) $str.= "<br>".ROOT_NO_DATA."!";
		echo $str;
?>
		</td>
		</tr>
		</table>
 <br class="clear" />
		</div>
             <br class="clear" />
	</div>
</body>
</html>